Portable or mobile electronic devices are used in a wide variety of applications and environments. The ubiquity of such devices as mobile phones, digital cameras, personal digital assistants (PDAs) handheld music and media players, portable video game devices and controllers, mobile internet devices (MIDs), personal navigation devices (PNDs), and other portable devices attest to the popularity and desire for these types of devices. Motion sensors, such as inertial sensors like accelerometers, gyroscopes, can be used in handheld electronic devices. For instance, accelerometers can be used for measuring acceleration including gravity, and gyroscopes can be used for measuring angular velocity of a portable electronic device. This information can be used to determine the spatial orientation and position of the device. In addition to inertial sensors, portable electronic devices also may be equipped with other types of sensors such as a magnetometer, for instance, which can be used as a compass, and GPS, which can be used to determine the device's position on Earth.
Many applications could benefit from the accurate determination of the spatial orientation and position of portable electronic devices. For instance, some portable device may use the orientation or relative motion of the device as a source of user input. Video game console controllers, for example, may use accelerometers to detect motion of the hand controller that is used to provide input to a game. Other game controllers may be used as a three dimensional gesture input device (e.g., a virtual golf club). Other applications that may use such spatial information include augmented reality applications, which can provide real-time visualization with respect to the physical position and orientation of the portable device. In yet another application, image stabilization is often a significant feature in even low- or mid-end digital cameras, where lens or image sensors are shifted to compensate for hand jittering measured by a gyroscope.